<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SecBox注册账户</title>
<meta name="description" content="è¿æ¯ä¸ä¸ª user é¡µé¢">
<meta name="keywords" content="user">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed"
	href="assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="assets/css/amazeui.min.css" />
<link rel="stylesheet" href="assets/css/admin.css">
<script type="text/javascript">
	function dosubmit() {
		var th = document.form1;
		 var email = document.form1.email.value;
		 var pwd = document.getElementById("password").value;
		var regex = "[0-9a-zA-Z]{1,}@[0-9a-zA-Z]{1,}\\.(com|cn)";
		if (th.email.value == "") {
			alert("邮箱不能为空");
			th.email.focus();
			return;
		}
		if(email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
		  alert("邮箱格式不正确！");
		    th.email.focus();
			return;  
		}
		if (th.password.value == "") {
			alert("密码不能为空");
			th.password.focus();
			return;
		}
		if(pwd.length<6 || pwd.length>10){
		  alert("密码长度为6--10位");
			th.password.focus();
			return;
		}
		th.action="<%=path%>/re.jsp";
		th.submit();

	}
</script>
<script> 

//取出传回来的参数error并与yes比较
  var zhucee ='<%=request.getParameter("zhuce")%>';
  if(zhucee=='yes'){
   alert("该邮箱已经注册！！!");
  }
</script>
<script> 

//取出传回来的参数error并与yes比较
  var zhucecgg ='<%=request.getParameter("zhucecg")%>';
	if (zhucecgg == 'yes') {
		alert("注册成功！！！");
	}
</script>
<script type="text/javascript">
	//判断输入密码的类型  
	function CharMode(iN) {
		if (iN >= 48 && iN <= 57) //数字  
			return 1;
		if (iN >= 65 && iN <= 90) //大写  
			return 2;
		if (iN >= 97 && iN <= 122) //小写  
			return 4;
		else
			return 8;
	}
	//bitTotal函数  
	//计算密码模式  
	function bitTotal(num) {
		modes = 0;
		for (i = 0; i < 4; i++) {
			if (num & 1)
				modes++;
			num >>>= 1;
		}
		return modes;
	}
	//返回强度级别  
	function checkStrong(sPW) {
		if (sPW.length <= 4)
			return 0; //密码太短  
		Modes = 0;
		for (i = 0; i < sPW.length; i++) {
			//密码模式  
			Modes |= CharMode(sPW.charCodeAt(i));
		}
		return bitTotal(Modes);
	}

	//显示颜色  
	function pwStrength(pwd) {
		O_color = "#eeeeee";
		L_color = "#FF0000";
		M_color = "#FF9900";
		H_color = "#33CC00";
		if (pwd == null || pwd == '') {
			Lcolor = Mcolor = Hcolor = O_color;
		} else {
			S_level = checkStrong(pwd);
			switch (S_level) {
			case 0:
				Lcolor = Mcolor = Hcolor = O_color;
			case 1:
				Lcolor = L_color;
				Mcolor = Hcolor = O_color;
				break;
			case 2:
				Lcolor = Mcolor = M_color;
				Hcolor = O_color;
				break;
			default:
				Lcolor = Mcolor = Hcolor = H_color;
			}
		}
		document.getElementById("strength_L").style.background = Lcolor;
		document.getElementById("strength_M").style.background = Mcolor;
		document.getElementById("strength_H").style.background = Hcolor;
		return;
	}
</script>
</head>

<body bgColor=#ffffff
	onload="MM_preloadImages('<%=path%>/images/ok_2.jpg', '<%=path%>/images/fh_2.jpg')">

	<header class="am-topbar am-topbar-inverse admin-header">
	<div class="am-topbar-brand">
		<strong>SecBox</strong> <small>Register Page</small>
	</div>
	<button
		class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only"
		data-am-collapse="{target: '#topbar-collapse'}">
		<span class="am-sr-only">å¯¼èªåæ¢</span> <span
			class="am-icon-bars"></span>
	</button>

	</header>

	<div class="am-cf admin-main">
		<!-- content start -->
		<div class="admin-content">
			<div class="admin-content-body">
				<div class="am-cf am-padding am-padding-bottom-0">
					<div class="am-fl am-cf">
						<strong class="am-text-primary am-text-lg">注册</strong> / <small>Register
							information</small>
					</div>
				</div>

				<hr />

				<div class="am-g">
					<div class="am-u-sm-12 am-u-md-4 am-u-md-push-8"></div>

					<div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
						<form class="am-form am-form-horizontal" action="" name="form1"
							method="post">
							<div class="am-form-group">
								<label for="user-name" class="am-u-sm-3 am-form-label">邮箱</label>
								<div class="am-u-sm-9">
									<INPUT type="text" name="email" minLength="1"> <small></small>
								</div>
							</div>


							<div class="am-form-group">
								<label for="user-password" class="am-u-sm-3 am-form-label">密码</label>
								<div class="am-u-sm-9">
									<INPUT type="password" name="password" minLength="1"
										id="password" onKeyUp="pwStrength(this.value)"
										onBlur="pwStrength(this.value)"> <font size="3"><strong>
											<table width="450px" border="1" cellspacing="0"
												cellpadding="1" bordercolor="#eeeeee" height="2px"
												style='display: inline'>
												<tr align="center" bgcolor="#f5f5f5">
													<td width="25%">密码强度:</td>
													<td width="25%" id="strength_L">弱</td>
													<td width="25%" id="strength_M">中</td>
													<td width="25%" id="strength_H">强</td>
												</tr>
											</table>
									</strong> </font> <small></small>
								</div>
							</div>


							<div class="am-form-group">
								<div class="am-u-sm-9 am-u-sm-push-3">


									<a href="javascript:dosubmit();"><img
										src="<%=path%>/images/ok_1.jpg" name="Image8" width="60"
										height="22" border="0"> </a>&nbsp; <a
										href="<%=path%>/register.jsp"><img
										src="<%=path%>/images/fh_1.jpg" name="Image9" width="60"
										height="22" border="0"> </a>


								</div>
							</div>
						</form>
					</div>
				</div>
			</div>

			<footer class="admin-content-footer">
			<hr>
			</footer>

		</div>
		<!-- content end -->
	</div>

	<a href="#"
		class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

	<footer>
	<hr>

	</footer>

	<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

	<!--[if (gte IE 9)|!(IE)]><!-->
	<script src="assets/js/jquery.min.js"></script>
	<!--<![endif]-->
	<script src="assets/js/amazeui.min.js"></script>

	<script src="assets/js/app.js"></script>

</body>
</html>
